home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
-
- Dim fso
- Dim f
- Dim FilePath
- Dim TextLine
-
- Dim tcApp
- Dim ActiveDrawing
-
- Sub LoadText()
-
- Dim gxGrs
- Dim gxGr
-
- Dim x
- Dim y
-
- x = 0
- y = 0
-
- FilePath = WScript.ScriptFullName '"J:\TurboCADSDK\Program\VBA\LoadLine\mdlLoadLine.bas"
- Set f = fso.OpenTextFile(FilePath, 1)
-
- MsgBox FilePath & " opened"
-
- Set gxGrs = ActiveDrawing.Graphics
- Do While Not f.AtEndOfStream ' Loop until end of file.
- TextLine = f.ReadLine
-
- Set gxGr = gxGrs.AddText(TextLine, x, y, 0, 10)
- gxGr.Draw
- y = y - 10
- Loop
-
- f.Close
-
- ActiveDrawing.ActiveView.ZoomToExtents
-
- MsgBox "Done"
-
- End Sub
-
- Set fso = CreateObject("Scripting.FileSystemObject")
-
- Set tcApp = CreateObject("TurboCAD.Application")
- Set ActiveDrawing = tcApp.ActiveDrawing
- LoadText
-